package net.zdsoft.wpchat.support.service;

import java.io.IOException;

import net.zdsoft.wpchat.support.entity.ResultPack;
import net.zdsoft.wpchat.support.exception.SqlParseException;

/**
 * sql语法执行service
 *
 * @author xuan
 */
public interface SqlTaskService {
	/**
	 * 分割SQL语句，处理注释，切割等
	 *
	 * @param sqlStatement
	 * @param slashComments
	 * @return
	 * @throws IOException
	 */
	String[] splitSql(String sqlStatement, boolean slashComments)
			throws IOException;

	/**
	 * 执行语句，包括更新，删除
	 *
	 * @param taskContent
	 * @param pageNum
	 *            支持多句查询，该分页代码对应执行相对顺序的语句
	 * @return
	 */
	ResultPack[] executeQuery(String taskContent, int pageNum)
			throws SqlParseException;

	/**
	 * 执行语法
	 *
	 * @param sqlContent
	 * @return
	 * @throws SqlParseException
	 */
	int[] executeUpdate(String sqlContent) throws SqlParseException;

}
